/**
 * 
 */
package it.uniroma3.dia.digraph.algorithm.utility.stackedtri;

import it.uniroma3.dia.digraph.algorithm.utility.Utility;

import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.graphdrawing.graphml.xmlns.GraphType;

/**
 * @author Cionzo
 *
 */
public class StackedTriGraph {
	
	private GraphType graph;
	private Map<Integer, List<StackedTriNode>> nodes;
	private List<StackedTriNode> nodelist; 
	
	public StackedTriGraph() {}
	
	public StackedTriGraph(GraphType graph){
		this.graph = graph;
		this.nodes = Utility.getDepthToNodes(graph);
		this.nodelist = new LinkedList<StackedTriNode>();
		
		for (List<StackedTriNode> l : this.nodes.values())
			nodelist.addAll(l);
	}
	
	
	/**
	 * @return the graph
	 */
	public GraphType getGraph() {
		return graph;
	}
	/**
	 * @param graph the graph to set
	 */
	public void setGraph(GraphType graph) {
		this.graph = graph;
	}
	/**
	 * @return the nodes
	 */
	public Map<Integer, List<StackedTriNode>> getNodes() {
		return nodes;
	}
	/**
	 * @param nodes the nodes to set
	 */
	public void setNodes(Map<Integer, List<StackedTriNode>> nodes) {
		this.nodes = nodes;
	}
	/**
	 * @param nodelist the nodelist to set
	 */
	public void setNodelist(List<StackedTriNode> nodelist) {
		this.nodelist = nodelist;
	}
	/**
	 * @return the nodelist
	 */
	public List<StackedTriNode> getNodelist() {
		return nodelist;
	}

}
